Skip to contentSkip to conversation

Change in openvpn[master]: Implement multiline responses for pkcs11-id commands

Openvpn-devel Superseded Name of user not set (Code Review) via Openvpn-devel 2 participants 27 messages Nov 7 – Dec 2 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): gerrit.1794059437000.I09e55085cde6dbc0040e111a42128527d59832b8@gerrit.openvpn.net

#1 lore raw

Attention is currently required from: Arne Schwabe.

Hello Arne Schwabe,

I'd like you to do a code review.
Please visit

    https://gerrit.openvpn.net/c/openvpn/+/2148?usp=email

to review the following change.

Change subject: Implement multiline responses for pkcs11-id commands
......................................................................

Implement multiline responses for pkcs11-id commands

Responses to the management interface commands pkcs11-id-[get|count] did not follow the standard syntax, but instead looked like notifications.

Introduce a new management interface version to rewrite both commands to conform to the common multiline + END syntax. At the same time it is now possible to query all PKCS#11 ids using "all" or a range from "start" to "end" - 1. Failures to retrieve an id will return a partial response terminated by an "ERROR" message including the erroneous index.

The response format was changed to comma separated (index,id,cert_blob) which is easier to parse.

Change-Id I09e55085cde6dbc0040e111a42128527d59832b8

---
M doc/management-notes.txt
M src/openvpn/manage.c
M src/openvpn/manage.h

3 files changed, 167 insertions(+), 30 deletions(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/48/2148/1

doc/management-notes.txt +71 -3
index 6c798c0..299cd29 100644
@@ -619,21 +619,89 @@
 
 Retrieve available number of certificates.
 
-Example:
+Example for client version < 7:
 
      pkcs11-id-count
      >PKCS11ID-COUNT:5
 
+Example for client version >= 7:
+
+     pkcs11-id-count
+     5
+     END
+
 COMMAND -- pkcs11-id-get  (OpenVPN 2.1 or higher)
 -------------------------------------------------
 
+  pkcs11-id-get <index>
+
 Retrieve certificate by index, the ID string should be provided
 as PKCS#11 identity, the blob is a base 64 encoded certificate.
 
-Example:
+Example for client version < 7:
 
      pkcs11-id-get 1
-     PKCS11ID-ENTRY:'1', ID:'<snip>', BLOB:'<snip>'
+     >PKCS11ID-ENTRY:'1', ID:'<snip>', BLOB:'<snip>'
+
+For client versions >= 7 it is also possible to retrieve multiple
+PKCS#11 identities from index <start> to <end>-1. Alternatively
+<start> = "all" retrieves all PKCS#11 identities. A comma separated
+list including index, PKCS#11 id and the base 64 encoded certificate
+will be returned. If any id retrieval results in a failure, the returned
+list will be partial and terminated by "ERROR: .." instead of "END".
+The "ERROR" message will include the index of failure.
+
+  pkcs11-id-get <index>
+  pkcs11-id-get <start> <end>
+  pkcs11-id-get all
+
+Example 1:
+
+  Management interface client sends:
+
+    pkcs11-id-get 1
+
+  OpenVPN daemon responds with:
+
+    1,<id>,<blob>
+    END
+
+Example 2:
+
+  Management interface client sends:
+
+    pkcs11-id-get 1 3
+
+  OpenVPN daemon responds with:
+
+    1,<id_a>,<blob_a>
+    2,<id_b>,<blob_b>
+    END
+
+Example 3:
+
+  Management interface client sends:
+
+    pkcs11-id-get all
+
+  OpenVPN daemon with 3 PKCS#11 identities responds with:
+
+    0,<id_a>,<blob_a>
+    1,<id_b>,<blob_b>
+    2,<id_c>,<blob_c>
+    END
+
+Example 4:
+
+  Management interface client sends:
+
+    pkcs11-id-get all
+
+  OpenVPN daemon with 3 PKCS#11 identities fails to retrieve index 1
+
+    0,<id_a>,<blob_a>
+    ERROR: Failed to load PKCS#11 id at index: 1
+
 
 COMMAND -- client-auth  (OpenVPN 2.1 or higher)
 -----------------------------------------------
src/openvpn/manage.c +95 -26

164 lines not on this page · raw message

src/openvpn/manage.h +1 -1
index 82c0caa..1d2aff1 100644
@@ -50,7 +50,7 @@
 #include "socket_util.h"
 #include "mroute.h"
 
-#define MANAGEMENT_VERSION                  6
+#define MANAGEMENT_VERSION                  7
 #define MANAGEMENT_N_PASSWORD_RETRIES       3
 #define MANAGEMENT_LOG_HISTORY_INITIAL_SIZE 100
 #define MANAGEMENT_ECHO_BUFFER_SIZE         100

--
To view, visit https://gerrit.openvpn.net/c/openvpn/+/2148?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: newchange
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I09e55085cde6dbc0040e111a42128527d59832b8
Gerrit-Change-Number: 2148
Gerrit-PatchSet: 1
Gerrit-Owner: Name of user not set #1000067
Gerrit-Reviewer: Arne Schwabe <[email protected]>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: Arne Schwabe <[email protected]>

_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

#2 lore raw
In reply to a message not in the archive

Attention is currently required from: Arne Schwabe, [email protected].

Selva Nair has posted comments on this change by [email protected]. ( https://gerrit.openvpn.net/c/openvpn/+/2148?usp=email )

Change subject: Implement multiline responses for pkcs11-id commands
......................................................................

Patch Set 1: Code-Review-1

(4 comments)

Patchset:

PS1:
Apart from comments below, in management-notes.txt, under OUTPUT_FORMAT no. (2), we say 'the last line will be "END"'. Add 'or "ERROR"' to it.

File doc/management-notes.txt:

https://gerrit.openvpn.net/c/openvpn/+/2148/comment/5cc4461f_a8ffdb34?usp=email :
PS1, Line 631: END
Describe the protocol in the both cases separately from examples? Like:

For management client versions < 7:

pkcs11-id-count

The reply is ">PKCS11ID-COUNT:<count>".

Example:

pkcs11-id-count
\>PKCS11ID-COUNT:5

For management client versions >= 7:

pkcs11-id-count

The reply is a decimal count followed by "END" on a line of its own.

Example:

pkcs11-id-count
5
END

https://gerrit.openvpn.net/c/openvpn/+/2148/comment/c76c252a_87366f38?usp=email :
PS1, Line 641: Example for client version < 7:
This section is confusing. Separate client version < 7 and >= 7 cleanly and provide protocol description separately from examples?

For management client versions < 7:

pkcs11-id-get <index>

.. desccribe legacy reply format.

Example:
...

For management client versions >= 7:

pkcs11-id-get <index>
pkcs11-id-get <start> <end>
pkcs11-id-get all

...index/range semantics, record format, END/ERROR termination...

Examples:
...

Also no need to retain the original '<snip>' as that's not how other examples are written. ID:'<id>', BLOB:'<blob>' is better.

File src/openvpn/manage.c:

https://gerrit.openvpn.net/c/openvpn/+/2148/comment/049a071a_702e63d8?usp=email :
PS1, Line 918:
Two helpers split a small parsing operation, interpret the start argument twice, and mix parsing with bounds clamping. A poor abstraction. I don’t see sufficient maintenance benefit from this. Better to leave remote-entry-get unchanged and use similar parsing logic here.

A better range parsing and validation could be a follow up.

--
To view, visit https://gerrit.openvpn.net/c/openvpn/+/2148?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: comment
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I09e55085cde6dbc0040e111a42128527d59832b8
Gerrit-Change-Number: 2148
Gerrit-PatchSet: 1
Gerrit-Owner: [email protected]
Gerrit-Reviewer: Arne Schwabe <[email protected]>
Gerrit-Reviewer: Selva Nair <[email protected]>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: [email protected]
Gerrit-Attention: Arne Schwabe <[email protected]>
Gerrit-Comment-Date: Sat, 07 Nov 2026 17:10:52 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes

_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

#3 lore raw
In reply to a message not in the archive

Attention is currently required from: Arne Schwabe, Selva Nair, [email protected].

Hello Arne Schwabe, Selva Nair,

I'd like you to reexamine a change. Please visit

    https://gerrit.openvpn.net/c/openvpn/+/2148?usp=email

to look at the new patch set (#2).

The following approvals got outdated and were removed:
Code-Review-1 by Selva Nair

Change subject: Implement multiline responses for pkcs11-id commands
......................................................................

Implement multiline responses for pkcs11-id commands

Responses to the management interface commands pkcs11-id-[get|count] did not follow the standard syntax, but instead looked like notifications.

Introduce a new management interface version to rewrite both commands to conform to the common multiline + END syntax. At the same time it is now possible to query all PKCS#11 ids using "all" or a range from "start" to "end" - 1. Failures to retrieve an id will return a partial response terminated by an "ERROR" message including the erroneous index.

The response format was changed to comma separated (index,id,cert_blob) which is easier to parse.

Change-Id I09e55085cde6dbc0040e111a42128527d59832b8

---
M doc/management-notes.txt
M src/openvpn/manage.c
M src/openvpn/manage.h

3 files changed, 164 insertions(+), 21 deletions(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/48/2148/2

doc/management-notes.txt +89 -3
index 6c798c0..42ea644 100644
@@ -617,23 +617,109 @@
 COMMAND -- pkcs11-id-count  (OpenVPN 2.1 or higher)
 ---------------------------------------------------
 
-Retrieve available number of certificates.
+Retrieve available number of PKCS#11 certificates.
+
+For management client versions <7:
+
+     pkcs11-id-count
+
+The reply is ">PKCS11ID-COUNT:<count>".
 
 Example:
 
      pkcs11-id-count
      >PKCS11ID-COUNT:5
 
+For management client versions >= 7:
+
+     pkcs11-id-count
+
+The reply is a decimal count followed by "END" on a separate line.
+
+Example:
+
+     pkcs11-id-count
+     5
+     END
+
 COMMAND -- pkcs11-id-get  (OpenVPN 2.1 or higher)
 -------------------------------------------------
 
+Retrieve PKCS#11 certificates.
+
+For management client versions < 7:
+
+  pkcs11-id-get <index>
+
 Retrieve certificate by index, the ID string should be provided
 as PKCS#11 identity, the blob is a base 64 encoded certificate.
 
 Example:
 
      pkcs11-id-get 1
-     PKCS11ID-ENTRY:'1', ID:'<snip>', BLOB:'<snip>'
+     >PKCS11ID-ENTRY:'1', ID:'<id>', BLOB:'<blob>'
+
+For management client versions >= 7:
+
+  pkcs11-id-get <index>
+  pkcs11-id-get <start> <end>
+  pkcs11-id-get all
+
+Retrieve a single PKCS#11 certificate at index <index> or multiple
+PKCS#11 certificates from index <start> to <end>-1. Alternatively
+<start> = "all" retrieves all PKCS#11 certificates. A comma separated
+list including index, PKCS#11 id and the base 64 encoded certificate
+will be returned. If any id retrieval results in a failure, the returned
+list will be partial and terminated by "ERROR: .." instead of "END".
+The "ERROR" message will include the index of failure.
+
+Example 1:
+
+  Management interface client sends:
+
+    pkcs11-id-get 1
+
+  OpenVPN daemon responds with:
+
+    1,<id>,<blob>
+    END
+
+Example 2:
+
+  Management interface client sends:
+
+    pkcs11-id-get 1 3
+
+  OpenVPN daemon responds with:
+
+    1,<id_a>,<blob_a>
+    2,<id_b>,<blob_b>
+    END
+
+Example 3:
+
+  Management interface client sends:
+
+    pkcs11-id-get all
+
+  OpenVPN daemon with 3 PKCS#11 certificates responds with:
+
+    0,<id_a>,<blob_a>
+    1,<id_b>,<blob_b>
+    2,<id_c>,<blob_c>
+    END
+
+Example 4:
+
+  Management interface client sends:
+
+    pkcs11-id-get all
+
+  OpenVPN daemon with 3 PKCS#11 certificates fails to retrieve index 1
+
+    0,<id_a>,<blob_a>
+    ERROR: Failed to load PKCS#11 id at index: 1
+
 
 COMMAND -- client-auth  (OpenVPN 2.1 or higher)
 -----------------------------------------------
@@ -1240,7 +1326,7 @@
     "ERROR: [text]".
 
 (2) For commands which print multiple lines of output,
-    the last line will be "END".
+    the last line will be "END" or "ERROR: [text]".
 
 (3) Real-time messages will be in the form ">[source]:[text]",
     where source is "CLIENT", "ECHO", "FATAL", "HOLD", "INFO", "LOG",
src/openvpn/manage.c +74 -17

122 lines not on this page · raw message

src/openvpn/manage.h +1 -1
index 82c0caa..1d2aff1 100644
@@ -50,7 +50,7 @@
 #include "socket_util.h"
 #include "mroute.h"
 
-#define MANAGEMENT_VERSION                  6
+#define MANAGEMENT_VERSION                  7
 #define MANAGEMENT_N_PASSWORD_RETRIES       3
 #define MANAGEMENT_LOG_HISTORY_INITIAL_SIZE 100
 #define MANAGEMENT_ECHO_BUFFER_SIZE         100

--
To view, visit https://gerrit.openvpn.net/c/openvpn/+/2148?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: newpatchset
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I09e55085cde6dbc0040e111a42128527d59832b8
Gerrit-Change-Number: 2148
Gerrit-PatchSet: 2
Gerrit-Owner: [email protected]
Gerrit-Reviewer: Arne Schwabe <[email protected]>
Gerrit-Reviewer: Selva Nair <[email protected]>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: Selva Nair <[email protected]>
Gerrit-Attention: [email protected]
Gerrit-Attention: Arne Schwabe <[email protected]>

_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

#4 lore raw
In reply to a message not in the archive

Attention is currently required from: Arne Schwabe, [email protected].

Selva Nair has posted comments on this change by [email protected]. ( https://gerrit.openvpn.net/c/openvpn/+/2148?usp=email )

Change subject: Implement multiline responses for pkcs11-id commands
......................................................................

Patch Set 2:

(5 comments)

Patchset:

PS1:

Quoted 1 line

Apart from comments below, in management-notes.txt, under OUTPUT_FORMAT no. […]

Done

Patchset:

PS2:
I tried re-pushing this to trigger the Buildbot runs, but got:

error: remote unpack failed: error Missing tree f6bb98471e275a4c88b6e8d969015945b6cebff5

Does anyone know how to resolve this?

The patch looks good now. The commit message mentions the new management version, but could you make the compatibility behavior explicit: the new command forms and response format apply only to clients announcing version >= 7; older clients retain the existing behavior. Sorry I missed this in the earlier review.

File doc/management-notes.txt:

https://gerrit.openvpn.net/c/openvpn/+/2148/comment/5fdea454_4e3a2211?usp=email :
PS1, Line 631: END

Quoted 1 line

Describe the protocol in the both cases separately from examples? Like: […]

Done

https://gerrit.openvpn.net/c/openvpn/+/2148/comment/8366e0e0_e327e8ff?usp=email :
PS1, Line 641: Example for client version < 7:

Quoted 1 line

This section is confusing. […]

Done

File src/openvpn/manage.c:

https://gerrit.openvpn.net/c/openvpn/+/2148/comment/1392ebf8_0d4fbd3f?usp=email :
PS1, Line 918:

Quoted 1 line

Two helpers split a small parsing operation, interpret the start argument twice, and mix parsing wit […]

Done

--
To view, visit https://gerrit.openvpn.net/c/openvpn/+/2148?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: comment
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I09e55085cde6dbc0040e111a42128527d59832b8
Gerrit-Change-Number: 2148
Gerrit-PatchSet: 2
Gerrit-Owner: [email protected]
Gerrit-Reviewer: Arne Schwabe <[email protected]>
Gerrit-Reviewer: Selva Nair <[email protected]>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: [email protected]
Gerrit-Attention: Arne Schwabe <[email protected]>
Gerrit-Comment-Date: Sun, 08 Nov 2026 16:10:15 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Selva Nair <[email protected]>

_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

#5 lore raw
In reply to a message not in the archive

Attention is currently required from: Arne Schwabe, Frank Lichtenheld, [email protected].

Gert Doering has posted comments on this change by [email protected]. ( https://gerrit.openvpn.net/c/openvpn/+/2148?usp=email )

Change subject: Implement multiline responses for pkcs11-id commands
......................................................................

Patch Set 2:

(1 comment)

Patchset:

PS2:

Quoted 1 line

I tried re-pushing this to trigger the Buildbot runs, but got: […]

I have seen this "Missing tree" message on a different patch, which made no sense whatsoever (pushing a v2 from the very same tree, same parent commit). I'd just retry and if it does not work complain to @[email protected] tomorrow

--
To view, visit https://gerrit.openvpn.net/c/openvpn/+/2148?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: comment
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I09e55085cde6dbc0040e111a42128527d59832b8
Gerrit-Change-Number: 2148
Gerrit-PatchSet: 2
Gerrit-Owner: [email protected]
Gerrit-Reviewer: Arne Schwabe <[email protected]>
Gerrit-Reviewer: Selva Nair <[email protected]>
Gerrit-CC: Frank Lichtenheld <[email protected]>
Gerrit-CC: Gert Doering <[email protected]>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: [email protected]
Gerrit-Attention: Arne Schwabe <[email protected]>
Gerrit-Attention: Frank Lichtenheld <[email protected]>
Gerrit-Comment-Date: Sun, 08 Nov 2026 16:12:56 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Selva Nair <[email protected]>

_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

#6 lore raw
In reply to a message not in the archive

Attention is currently required from: Arne Schwabe, Frank Lichtenheld, [email protected].

Selva Nair has posted comments on this change by [email protected]. ( https://gerrit.openvpn.net/c/openvpn/+/2148?usp=email )

Change subject: Implement multiline responses for pkcs11-id commands
......................................................................

Patch Set 2:

(1 comment)

Patchset:

PS2:

Quoted 1 line

I have seen this "Missing tree" message on a different patch, which made no sense whatsoever (pushin […]

Tried with a fresh clone of gerrit and the tree error is gone, but:
! [remote rejected] HEAD -> refs/for/master (cannot add patch set to 2148.)
error: failed to push some refs to 'ssh://gerrit.openvpn.net:29418/openvpn.git'

May be I no longer have permission to amend someone else's patchset or I forgot how to do this correctly.

--
To view, visit https://gerrit.openvpn.net/c/openvpn/+/2148?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: comment
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I09e55085cde6dbc0040e111a42128527d59832b8
Gerrit-Change-Number: 2148
Gerrit-PatchSet: 2
Gerrit-Owner: [email protected]
Gerrit-Reviewer: Arne Schwabe <[email protected]>
Gerrit-Reviewer: Selva Nair <[email protected]>
Gerrit-CC: Frank Lichtenheld <[email protected]>
Gerrit-CC: Gert Doering <[email protected]>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: [email protected]
Gerrit-Attention: Arne Schwabe <[email protected]>
Gerrit-Attention: Frank Lichtenheld <[email protected]>
Gerrit-Comment-Date: Sun, 08 Nov 2026 17:08:18 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Selva Nair <[email protected]>
Comment-In-Reply-To: Gert Doering <[email protected]>

_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

#7 lore raw
In reply to a message not in the archive

Attention is currently required from: Arne Schwabe, Frank Lichtenheld, [email protected].

Hello Arne Schwabe, Selva Nair,

I'd like you to reexamine a change. Please visit

    https://gerrit.openvpn.net/c/openvpn/+/2148?usp=email

to look at the new patch set (#3).

Change subject: Implement multiline responses for pkcs11-id commands
......................................................................

Implement multiline responses for pkcs11-id commands

Responses to the management interface commands pkcs11-id-[get|count] did not follow the standard syntax, but instead looked like notifications.

Introduce a new management interface version so that clients announcing versions >= 7 will receive responses in the new format while keeping compatibility for older client versions.

If a client announces a management version >= 7 the responses conform to the common multiline + END syntax. At the same time, it is now possible to query all PKCS#11 ids using "all" or a range from "start" to "end" - 1. Failures to retrieve an id will return a partial response terminated by an "ERROR" message including the erroneous index. The response format for pkcs11-id-get was changed to return a comma separated list (index,id,cert_blob) which is easier to parse.

Change-Id I09e55085cde6dbc0040e111a42128527d59832b8

---
M doc/management-notes.txt
M src/openvpn/manage.c
M src/openvpn/manage.h

3 files changed, 164 insertions(+), 21 deletions(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/48/2148/3

doc/management-notes.txt +89 -3
index 6c798c0..42ea644 100644
@@ -617,23 +617,109 @@
 COMMAND -- pkcs11-id-count  (OpenVPN 2.1 or higher)
 ---------------------------------------------------
 
-Retrieve available number of certificates.
+Retrieve available number of PKCS#11 certificates.
+
+For management client versions <7:
+
+     pkcs11-id-count
+
+The reply is ">PKCS11ID-COUNT:<count>".
 
 Example:
 
      pkcs11-id-count
      >PKCS11ID-COUNT:5
 
+For management client versions >= 7:
+
+     pkcs11-id-count
+
+The reply is a decimal count followed by "END" on a separate line.
+
+Example:
+
+     pkcs11-id-count
+     5
+     END
+
 COMMAND -- pkcs11-id-get  (OpenVPN 2.1 or higher)
 -------------------------------------------------
 
+Retrieve PKCS#11 certificates.
+
+For management client versions < 7:
+
+  pkcs11-id-get <index>
+
 Retrieve certificate by index, the ID string should be provided
 as PKCS#11 identity, the blob is a base 64 encoded certificate.
 
 Example:
 
      pkcs11-id-get 1
-     PKCS11ID-ENTRY:'1', ID:'<snip>', BLOB:'<snip>'
+     >PKCS11ID-ENTRY:'1', ID:'<id>', BLOB:'<blob>'
+
+For management client versions >= 7:
+
+  pkcs11-id-get <index>
+  pkcs11-id-get <start> <end>
+  pkcs11-id-get all
+
+Retrieve a single PKCS#11 certificate at index <index> or multiple
+PKCS#11 certificates from index <start> to <end>-1. Alternatively
+<start> = "all" retrieves all PKCS#11 certificates. A comma separated
+list including index, PKCS#11 id and the base 64 encoded certificate
+will be returned. If any id retrieval results in a failure, the returned
+list will be partial and terminated by "ERROR: .." instead of "END".
+The "ERROR" message will include the index of failure.
+
+Example 1:
+
+  Management interface client sends:
+
+    pkcs11-id-get 1
+
+  OpenVPN daemon responds with:
+
+    1,<id>,<blob>
+    END
+
+Example 2:
+
+  Management interface client sends:
+
+    pkcs11-id-get 1 3
+
+  OpenVPN daemon responds with:
+
+    1,<id_a>,<blob_a>
+    2,<id_b>,<blob_b>
+    END
+
+Example 3:
+
+  Management interface client sends:
+
+    pkcs11-id-get all
+
+  OpenVPN daemon with 3 PKCS#11 certificates responds with:
+
+    0,<id_a>,<blob_a>
+    1,<id_b>,<blob_b>
+    2,<id_c>,<blob_c>
+    END
+
+Example 4:
+
+  Management interface client sends:
+
+    pkcs11-id-get all
+
+  OpenVPN daemon with 3 PKCS#11 certificates fails to retrieve index 1
+
+    0,<id_a>,<blob_a>
+    ERROR: Failed to load PKCS#11 id at index: 1
+
 
 COMMAND -- client-auth  (OpenVPN 2.1 or higher)
 -----------------------------------------------
@@ -1240,7 +1326,7 @@
     "ERROR: [text]".
 
 (2) For commands which print multiple lines of output,
-    the last line will be "END".
+    the last line will be "END" or "ERROR: [text]".
 
 (3) Real-time messages will be in the form ">[source]:[text]",
     where source is "CLIENT", "ECHO", "FATAL", "HOLD", "INFO", "LOG",
src/openvpn/manage.c +74 -17

122 lines not on this page · raw message

src/openvpn/manage.h +1 -1
index 82c0caa..1d2aff1 100644
@@ -50,7 +50,7 @@
 #include "socket_util.h"
 #include "mroute.h"
 
-#define MANAGEMENT_VERSION                  6
+#define MANAGEMENT_VERSION                  7
 #define MANAGEMENT_N_PASSWORD_RETRIES       3
 #define MANAGEMENT_LOG_HISTORY_INITIAL_SIZE 100
 #define MANAGEMENT_ECHO_BUFFER_SIZE         100

--
To view, visit https://gerrit.openvpn.net/c/openvpn/+/2148?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: newpatchset
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I09e55085cde6dbc0040e111a42128527d59832b8
Gerrit-Change-Number: 2148
Gerrit-PatchSet: 3
Gerrit-Owner: [email protected]
Gerrit-Reviewer: Arne Schwabe <[email protected]>
Gerrit-Reviewer: Selva Nair <[email protected]>
Gerrit-CC: Frank Lichtenheld <[email protected]>
Gerrit-CC: Gert Doering <[email protected]>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: [email protected]
Gerrit-Attention: Arne Schwabe <[email protected]>
Gerrit-Attention: Frank Lichtenheld <[email protected]>

_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

#8 lore raw
In reply to a message not in the archive

Attention is currently required from: Arne Schwabe, Frank Lichtenheld, [email protected].

Hello Arne Schwabe, Selva Nair,

I'd like you to reexamine a change. Please visit

    https://gerrit.openvpn.net/c/openvpn/+/2148?usp=email

to look at the new patch set (#4).

Change subject: Implement multiline responses for pkcs11-id commands
......................................................................

Implement multiline responses for pkcs11-id commands

Responses to the management interface commands pkcs11-id-[get|count] did not follow the standard syntax, but instead looked like notifications.

Introduce a new management interface version so that clients announcing versions >= 7 will receive responses in the new format while keeping compatibility for older client versions.

If a client announces a management version >= 7 the responses conform to the common multiline + END syntax. At the same time, it is now possible to query all PKCS#11 ids using "all" or a range from "start" to "end" - 1. Failures to retrieve an id will return a partial response terminated by an "ERROR" message including the erroneous index. The response format for pkcs11-id-get was changed to return a comma separated list (index,id,cert_blob) which is easier to parse.

Change-Id I09e55085cde6dbc0040e111a42128527d59832b8

---
M doc/management-notes.txt
M src/openvpn/manage.c
M src/openvpn/manage.h

3 files changed, 164 insertions(+), 21 deletions(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/48/2148/4

doc/management-notes.txt +89 -3
index 6c798c0..42ea644 100644
@@ -617,23 +617,109 @@
 COMMAND -- pkcs11-id-count  (OpenVPN 2.1 or higher)
 ---------------------------------------------------
 
-Retrieve available number of certificates.
+Retrieve available number of PKCS#11 certificates.
+
+For management client versions <7:
+
+     pkcs11-id-count
+
+The reply is ">PKCS11ID-COUNT:<count>".
 
 Example:
 
      pkcs11-id-count
      >PKCS11ID-COUNT:5
 
+For management client versions >= 7:
+
+     pkcs11-id-count
+
+The reply is a decimal count followed by "END" on a separate line.
+
+Example:
+
+     pkcs11-id-count
+     5
+     END
+
 COMMAND -- pkcs11-id-get  (OpenVPN 2.1 or higher)
 -------------------------------------------------
 
+Retrieve PKCS#11 certificates.
+
+For management client versions < 7:
+
+  pkcs11-id-get <index>
+
 Retrieve certificate by index, the ID string should be provided
 as PKCS#11 identity, the blob is a base 64 encoded certificate.
 
 Example:
 
      pkcs11-id-get 1
-     PKCS11ID-ENTRY:'1', ID:'<snip>', BLOB:'<snip>'
+     >PKCS11ID-ENTRY:'1', ID:'<id>', BLOB:'<blob>'
+
+For management client versions >= 7:
+
+  pkcs11-id-get <index>
+  pkcs11-id-get <start> <end>
+  pkcs11-id-get all
+
+Retrieve a single PKCS#11 certificate at index <index> or multiple
+PKCS#11 certificates from index <start> to <end>-1. Alternatively
+<start> = "all" retrieves all PKCS#11 certificates. A comma separated
+list including index, PKCS#11 id and the base 64 encoded certificate
+will be returned. If any id retrieval results in a failure, the returned
+list will be partial and terminated by "ERROR: .." instead of "END".
+The "ERROR" message will include the index of failure.
+
+Example 1:
+
+  Management interface client sends:
+
+    pkcs11-id-get 1
+
+  OpenVPN daemon responds with:
+
+    1,<id>,<blob>
+    END
+
+Example 2:
+
+  Management interface client sends:
+
+    pkcs11-id-get 1 3
+
+  OpenVPN daemon responds with:
+
+    1,<id_a>,<blob_a>
+    2,<id_b>,<blob_b>
+    END
+
+Example 3:
+
+  Management interface client sends:
+
+    pkcs11-id-get all
+
+  OpenVPN daemon with 3 PKCS#11 certificates responds with:
+
+    0,<id_a>,<blob_a>
+    1,<id_b>,<blob_b>
+    2,<id_c>,<blob_c>
+    END
+
+Example 4:
+
+  Management interface client sends:
+
+    pkcs11-id-get all
+
+  OpenVPN daemon with 3 PKCS#11 certificates fails to retrieve index 1
+
+    0,<id_a>,<blob_a>
+    ERROR: Failed to load PKCS#11 id at index: 1
+
 
 COMMAND -- client-auth  (OpenVPN 2.1 or higher)
 -----------------------------------------------
@@ -1240,7 +1326,7 @@
     "ERROR: [text]".
 
 (2) For commands which print multiple lines of output,
-    the last line will be "END".
+    the last line will be "END" or "ERROR: [text]".
 
 (3) Real-time messages will be in the form ">[source]:[text]",
     where source is "CLIENT", "ECHO", "FATAL", "HOLD", "INFO", "LOG",
src/openvpn/manage.c +74 -17

122 lines not on this page · raw message

src/openvpn/manage.h +1 -1
index 82c0caa..1d2aff1 100644
@@ -50,7 +50,7 @@
 #include "socket_util.h"
 #include "mroute.h"
 
-#define MANAGEMENT_VERSION                  6
+#define MANAGEMENT_VERSION                  7
 #define MANAGEMENT_N_PASSWORD_RETRIES       3
 #define MANAGEMENT_LOG_HISTORY_INITIAL_SIZE 100
 #define MANAGEMENT_ECHO_BUFFER_SIZE         100

--
To view, visit https://gerrit.openvpn.net/c/openvpn/+/2148?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: newpatchset
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I09e55085cde6dbc0040e111a42128527d59832b8
Gerrit-Change-Number: 2148
Gerrit-PatchSet: 4
Gerrit-Owner: [email protected]
Gerrit-Reviewer: Arne Schwabe <[email protected]>
Gerrit-Reviewer: Selva Nair <[email protected]>
Gerrit-CC: Frank Lichtenheld <[email protected]>
Gerrit-CC: Gert Doering <[email protected]>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: [email protected]
Gerrit-Attention: Arne Schwabe <[email protected]>
Gerrit-Attention: Frank Lichtenheld <[email protected]>

_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

#9 lore raw
In reply to a message not in the archive

Attention is currently required from: Arne Schwabe, Frank Lichtenheld, [email protected].

Yuriy Darnobyt has posted comments on this change by [email protected]. ( https://gerrit.openvpn.net/c/openvpn/+/2148?usp=email )

Change subject: Implement multiline responses for pkcs11-id commands
......................................................................

Patch Set 4:

(1 comment)

Patchset:

PS2:

Quoted 1 line

Tried with a fresh clone of gerrit and the tree error is gone, but: […]

@[email protected] I did some permission changes when migrating to GitHub OAuth. And indeed I didn't add you into one of groups. Added now. Please try again.

--
To view, visit https://gerrit.openvpn.net/c/openvpn/+/2148?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: comment
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I09e55085cde6dbc0040e111a42128527d59832b8
Gerrit-Change-Number: 2148
Gerrit-PatchSet: 4
Gerrit-Owner: [email protected]
Gerrit-Reviewer: Arne Schwabe <[email protected]>
Gerrit-Reviewer: Selva Nair <[email protected]>
Gerrit-CC: Frank Lichtenheld <[email protected]>
Gerrit-CC: Gert Doering <[email protected]>
Gerrit-CC: Yuriy Darnobyt <[email protected]>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: [email protected]
Gerrit-Attention: Arne Schwabe <[email protected]>
Gerrit-Attention: Frank Lichtenheld <[email protected]>
Gerrit-Comment-Date: Mon, 09 Nov 2026 08:27:23 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Selva Nair <[email protected]>
Comment-In-Reply-To: Gert Doering <[email protected]>

_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

#10 lore raw
In reply to a message not in the archive

Attention is currently required from: Arne Schwabe, Frank Lichtenheld, Gert Doering, Yuriy Darnobyt, [email protected].

Selva Nair has posted comments on this change by [email protected]. ( https://gerrit.openvpn.net/c/openvpn/+/2148?usp=email )

Change subject: Implement multiline responses for pkcs11-id commands
......................................................................

Patch Set 5:

(1 comment)

Patchset:

PS2:

Quoted 1 line

@[email protected] I did some permission changes when migrating to GitHub OAuth. […]

Done

--
To view, visit https://gerrit.openvpn.net/c/openvpn/+/2148?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: comment
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I09e55085cde6dbc0040e111a42128527d59832b8
Gerrit-Change-Number: 2148
Gerrit-PatchSet: 5
Gerrit-Owner: [email protected]
Gerrit-Reviewer: Arne Schwabe <[email protected]>
Gerrit-Reviewer: Selva Nair <[email protected]>
Gerrit-CC: Frank Lichtenheld <[email protected]>
Gerrit-CC: Gert Doering <[email protected]>
Gerrit-CC: Yuriy Darnobyt <[email protected]>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: [email protected]
Gerrit-Attention: Arne Schwabe <[email protected]>
Gerrit-Attention: Gert Doering <[email protected]>
Gerrit-Attention: Frank Lichtenheld <[email protected]>
Gerrit-Attention: Yuriy Darnobyt <[email protected]>
Gerrit-Comment-Date: Mon, 09 Nov 2026 15:22:35 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Selva Nair <[email protected]>
Comment-In-Reply-To: Gert Doering <[email protected]>
Comment-In-Reply-To: Yuriy Darnobyt <[email protected]>

_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

#11 lore raw
In reply to a message not in the archive

Attention is currently required from: Arne Schwabe, Frank Lichtenheld, Gert Doering, Yuriy Darnobyt, [email protected].

Selva Nair has posted comments on this change by [email protected]. ( https://gerrit.openvpn.net/c/openvpn/+/2148?usp=email )

Change subject: Implement multiline responses for pkcs11-id commands
......................................................................

Patch Set 5: Code-Review+2

--
To view, visit https://gerrit.openvpn.net/c/openvpn/+/2148?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: comment
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I09e55085cde6dbc0040e111a42128527d59832b8
Gerrit-Change-Number: 2148
Gerrit-PatchSet: 5
Gerrit-Owner: [email protected]
Gerrit-Reviewer: Arne Schwabe <[email protected]>
Gerrit-Reviewer: Selva Nair <[email protected]>
Gerrit-CC: Frank Lichtenheld <[email protected]>
Gerrit-CC: Gert Doering <[email protected]>
Gerrit-CC: Yuriy Darnobyt <[email protected]>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: [email protected]
Gerrit-Attention: Arne Schwabe <[email protected]>
Gerrit-Attention: Gert Doering <[email protected]>
Gerrit-Attention: Frank Lichtenheld <[email protected]>
Gerrit-Attention: Yuriy Darnobyt <[email protected]>
Gerrit-Comment-Date: Mon, 09 Nov 2026 15:41:54 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes

_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

#12 lore raw

PATCH v5 1/1 Implement multiline responses for pkcs11-id commands

In reply to a message not in the archive

From: Marvin Wunderlich <[email protected]>

Responses to the management interface commands pkcs11-id-[get|count] did not follow the standard syntax, but instead looked like notifications.

Introduce a new management interface version so that clients announcing versions >= 7 will receive responses in the new format while keeping compatibility for older client versions.

If a client announces a management version >= 7 the responses conform to the common multiline + END syntax. At the same time, it is now possible to query all PKCS#11 ids using "all" or a range from "start" to "end" - 1. Failures to retrieve an id will return a partial response terminated by an "ERROR" message including the erroneous index. The response format for pkcs11-id-get was changed to return a comma separated list (index,id,cert_blob) which is easier to parse.

Change-Id I09e55085cde6dbc0040e111a42128527d59832b8

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/2148
---

This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to master.

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/2148
This mail reflects revision 5 of this Change.

Acked-by according to Gerrit (reflected above):
Selva Nair <[email protected]>

doc/management-notes.txt +89 -3
index 6c798c0..42ea644 100644
@@ -617,23 +617,109 @@
 COMMAND -- pkcs11-id-count  (OpenVPN 2.1 or higher)
 ---------------------------------------------------
 
-Retrieve available number of certificates.
+Retrieve available number of PKCS#11 certificates.
+
+For management client versions <7:
+
+     pkcs11-id-count
+
+The reply is ">PKCS11ID-COUNT:<count>".
 
 Example:
 
      pkcs11-id-count
      >PKCS11ID-COUNT:5
 
+For management client versions >= 7:
+
+     pkcs11-id-count
+
+The reply is a decimal count followed by "END" on a separate line.
+
+Example:
+
+     pkcs11-id-count
+     5
+     END
+
 COMMAND -- pkcs11-id-get  (OpenVPN 2.1 or higher)
 -------------------------------------------------
 
+Retrieve PKCS#11 certificates.
+
+For management client versions < 7:
+
+  pkcs11-id-get <index>
+
 Retrieve certificate by index, the ID string should be provided
 as PKCS#11 identity, the blob is a base 64 encoded certificate.
 
 Example:
 
      pkcs11-id-get 1
-     PKCS11ID-ENTRY:'1', ID:'<snip>', BLOB:'<snip>'
+     >PKCS11ID-ENTRY:'1', ID:'<id>', BLOB:'<blob>'
+
+For management client versions >= 7:
+
+  pkcs11-id-get <index>
+  pkcs11-id-get <start> <end>
+  pkcs11-id-get all
+
+Retrieve a single PKCS#11 certificate at index <index> or multiple
+PKCS#11 certificates from index <start> to <end>-1. Alternatively
+<start> = "all" retrieves all PKCS#11 certificates. A comma separated
+list including index, PKCS#11 id and the base 64 encoded certificate
+will be returned. If any id retrieval results in a failure, the returned
+list will be partial and terminated by "ERROR: .." instead of "END".
+The "ERROR" message will include the index of failure.
+
+Example 1:
+
+  Management interface client sends:
+
+    pkcs11-id-get 1
+
+  OpenVPN daemon responds with:
+
+    1,<id>,<blob>
+    END
+
+Example 2:
+
+  Management interface client sends:
+
+    pkcs11-id-get 1 3
+
+  OpenVPN daemon responds with:
+
+    1,<id_a>,<blob_a>
+    2,<id_b>,<blob_b>
+    END
+
+Example 3:
+
+  Management interface client sends:
+
+    pkcs11-id-get all
+
+  OpenVPN daemon with 3 PKCS#11 certificates responds with:
+
+    0,<id_a>,<blob_a>
+    1,<id_b>,<blob_b>
+    2,<id_c>,<blob_c>
+    END
+
+Example 4:
+
+  Management interface client sends:
+
+    pkcs11-id-get all
+
+  OpenVPN daemon with 3 PKCS#11 certificates fails to retrieve index 1
+
+    0,<id_a>,<blob_a>
+    ERROR: Failed to load PKCS#11 id at index: 1
+
 
 COMMAND -- client-auth  (OpenVPN 2.1 or higher)
 -----------------------------------------------
@@ -1240,7 +1326,7 @@
     "ERROR: [text]".
 
 (2) For commands which print multiple lines of output,
-    the last line will be "END".
+    the last line will be "END" or "ERROR: [text]".
 
 (3) Real-time messages will be in the form ">[source]:[text]",
     where source is "CLIENT", "ECHO", "FATAL", "HOLD", "INFO", "LOG",
src/openvpn/manage.c +74 -17

122 lines not on this page · raw message

src/openvpn/manage.h +1 -1
index 82c0caa..1d2aff1 100644
@@ -50,7 +50,7 @@
 #include "socket_util.h"
 #include "mroute.h"
 
-#define MANAGEMENT_VERSION                  6
+#define MANAGEMENT_VERSION                  7
 #define MANAGEMENT_N_PASSWORD_RETRIES       3
 #define MANAGEMENT_LOG_HISTORY_INITIAL_SIZE 100
 #define MANAGEMENT_ECHO_BUFFER_SIZE         100

_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

#13 lore raw
In reply to a message not in the archive

Attention is currently required from: Arne Schwabe, Frank Lichtenheld, Gert Doering, Yuriy Darnobyt, [email protected].

Hello Arne Schwabe, Selva Nair,

I'd like you to reexamine a change. Please visit

    https://gerrit.openvpn.net/c/openvpn/+/2148?usp=email

to look at the new patch set (#6).

The change is no longer submittable: checks~ChecksSubmitRule is unsatisfied now.

Change subject: Implement multiline responses for pkcs11-id commands
......................................................................

Implement multiline responses for pkcs11-id commands

Responses to the management interface commands pkcs11-id-[get|count] did not follow the standard syntax, but instead looked like notifications.

Introduce a new management interface version so that clients announcing versions >= 7 will receive responses in the new format while keeping compatibility for older client versions.

If a client announces a management version >= 7 the responses conform to the common multiline + END syntax. At the same time, it is now possible to query all PKCS#11 ids using "all" or a range from "start" to "end" - 1. Failures to retrieve an id will return a partial response terminated by an "ERROR" message including the erroneous index. The response format for pkcs11-id-get was changed to return a comma separated list (index,id,cert_blob) which is easier to parse.

Change-Id I09e55085cde6dbc0040e111a42128527d59832b8

---
M doc/management-notes.txt
M src/openvpn/manage.c
M src/openvpn/manage.h

3 files changed, 164 insertions(+), 21 deletions(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/48/2148/6

doc/management-notes.txt +89 -3
index 6c798c0..42ea644 100644
@@ -617,23 +617,109 @@
 COMMAND -- pkcs11-id-count  (OpenVPN 2.1 or higher)
 ---------------------------------------------------
 
-Retrieve available number of certificates.
+Retrieve available number of PKCS#11 certificates.
+
+For management client versions <7:
+
+     pkcs11-id-count
+
+The reply is ">PKCS11ID-COUNT:<count>".
 
 Example:
 
      pkcs11-id-count
      >PKCS11ID-COUNT:5
 
+For management client versions >= 7:
+
+     pkcs11-id-count
+
+The reply is a decimal count followed by "END" on a separate line.
+
+Example:
+
+     pkcs11-id-count
+     5
+     END
+
 COMMAND -- pkcs11-id-get  (OpenVPN 2.1 or higher)
 -------------------------------------------------
 
+Retrieve PKCS#11 certificates.
+
+For management client versions < 7:
+
+  pkcs11-id-get <index>
+
 Retrieve certificate by index, the ID string should be provided
 as PKCS#11 identity, the blob is a base 64 encoded certificate.
 
 Example:
 
      pkcs11-id-get 1
-     PKCS11ID-ENTRY:'1', ID:'<snip>', BLOB:'<snip>'
+     >PKCS11ID-ENTRY:'1', ID:'<id>', BLOB:'<blob>'
+
+For management client versions >= 7:
+
+  pkcs11-id-get <index>
+  pkcs11-id-get <start> <end>
+  pkcs11-id-get all
+
+Retrieve a single PKCS#11 certificate at index <index> or multiple
+PKCS#11 certificates from index <start> to <end>-1. Alternatively
+<start> = "all" retrieves all PKCS#11 certificates. A comma separated
+list including index, PKCS#11 id and the base 64 encoded certificate
+will be returned. If any id retrieval results in a failure, the returned
+list will be partial and terminated by "ERROR: .." instead of "END".
+The "ERROR" message will include the index of failure.
+
+Example 1:
+
+  Management interface client sends:
+
+    pkcs11-id-get 1
+
+  OpenVPN daemon responds with:
+
+    1,<id>,<blob>
+    END
+
+Example 2:
+
+  Management interface client sends:
+
+    pkcs11-id-get 1 3
+
+  OpenVPN daemon responds with:
+
+    1,<id_a>,<blob_a>
+    2,<id_b>,<blob_b>
+    END
+
+Example 3:
+
+  Management interface client sends:
+
+    pkcs11-id-get all
+
+  OpenVPN daemon with 3 PKCS#11 certificates responds with:
+
+    0,<id_a>,<blob_a>
+    1,<id_b>,<blob_b>
+    2,<id_c>,<blob_c>
+    END
+
+Example 4:
+
+  Management interface client sends:
+
+    pkcs11-id-get all
+
+  OpenVPN daemon with 3 PKCS#11 certificates fails to retrieve index 1
+
+    0,<id_a>,<blob_a>
+    ERROR: Failed to load PKCS#11 id at index: 1
+
 
 COMMAND -- client-auth  (OpenVPN 2.1 or higher)
 -----------------------------------------------
@@ -1240,7 +1326,7 @@
     "ERROR: [text]".
 
 (2) For commands which print multiple lines of output,
-    the last line will be "END".
+    the last line will be "END" or "ERROR: [text]".
 
 (3) Real-time messages will be in the form ">[source]:[text]",
     where source is "CLIENT", "ECHO", "FATAL", "HOLD", "INFO", "LOG",
src/openvpn/manage.c +74 -17

122 lines not on this page · raw message

src/openvpn/manage.h +1 -1
index 82c0caa..1d2aff1 100644
@@ -50,7 +50,7 @@
 #include "socket_util.h"
 #include "mroute.h"
 
-#define MANAGEMENT_VERSION                  6
+#define MANAGEMENT_VERSION                  7
 #define MANAGEMENT_N_PASSWORD_RETRIES       3
 #define MANAGEMENT_LOG_HISTORY_INITIAL_SIZE 100
 #define MANAGEMENT_ECHO_BUFFER_SIZE         100

--
To view, visit https://gerrit.openvpn.net/c/openvpn/+/2148?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: newpatchset
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I09e55085cde6dbc0040e111a42128527d59832b8
Gerrit-Change-Number: 2148
Gerrit-PatchSet: 6
Gerrit-Owner: [email protected]
Gerrit-Reviewer: Arne Schwabe <[email protected]>
Gerrit-Reviewer: Selva Nair <[email protected]>
Gerrit-CC: Frank Lichtenheld <[email protected]>
Gerrit-CC: Gert Doering <[email protected]>
Gerrit-CC: Yuriy Darnobyt <[email protected]>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: [email protected]
Gerrit-Attention: Arne Schwabe <[email protected]>
Gerrit-Attention: Gert Doering <[email protected]>
Gerrit-Attention: Frank Lichtenheld <[email protected]>
Gerrit-Attention: Yuriy Darnobyt <[email protected]>

_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

#14 lore raw
In reply to a message not in the archive

Attention is currently required from: Arne Schwabe, Frank Lichtenheld, Gert Doering, Yuriy Darnobyt.

[email protected] has posted comments on this change by [email protected]. ( https://gerrit.openvpn.net/c/openvpn/+/2148?usp=email )

Change subject: Implement multiline responses for pkcs11-id commands
......................................................................

Patch Set 6:

(1 comment)

Patchset:

PS6:
Sorry @[email protected] I had to push again, @[email protected]'s keen eyes spotted a typo in my author mail address.

--
To view, visit https://gerrit.openvpn.net/c/openvpn/+/2148?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: comment
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I09e55085cde6dbc0040e111a42128527d59832b8
Gerrit-Change-Number: 2148
Gerrit-PatchSet: 6
Gerrit-Owner: [email protected]
Gerrit-Reviewer: Arne Schwabe <[email protected]>
Gerrit-Reviewer: Selva Nair <[email protected]>
Gerrit-CC: Frank Lichtenheld <[email protected]>
Gerrit-CC: Gert Doering <[email protected]>
Gerrit-CC: Yuriy Darnobyt <[email protected]>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: Arne Schwabe <[email protected]>
Gerrit-Attention: Gert Doering <[email protected]>
Gerrit-Attention: Frank Lichtenheld <[email protected]>
Gerrit-Attention: Yuriy Darnobyt <[email protected]>
Gerrit-Comment-Date: Mon, 09 Nov 2026 18:12:24 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No

_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

#15 lore raw
In reply to a message not in the archive

Attention is currently required from: Arne Schwabe, Frank Lichtenheld, Gert Doering, Yuriy Darnobyt, [email protected].

Selva Nair has posted comments on this change by [email protected]. ( https://gerrit.openvpn.net/c/openvpn/+/2148?usp=email )

Change subject: Implement multiline responses for pkcs11-id commands
......................................................................

Patch Set 6: Code-Review+2

(1 comment)

Patchset:

PS6:

Quoted 1 line

Sorry @[email protected] I had to push again, @[email protected]. […]

Not sure this was needed, but repushed to make this ready again.

--
To view, visit https://gerrit.openvpn.net/c/openvpn/+/2148?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: comment
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I09e55085cde6dbc0040e111a42128527d59832b8
Gerrit-Change-Number: 2148
Gerrit-PatchSet: 6
Gerrit-Owner: [email protected]
Gerrit-Reviewer: Arne Schwabe <[email protected]>
Gerrit-Reviewer: Selva Nair <[email protected]>
Gerrit-CC: Frank Lichtenheld <[email protected]>
Gerrit-CC: Gert Doering <[email protected]>
Gerrit-CC: Yuriy Darnobyt <[email protected]>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: [email protected]
Gerrit-Attention: Arne Schwabe <[email protected]>
Gerrit-Attention: Gert Doering <[email protected]>
Gerrit-Attention: Frank Lichtenheld <[email protected]>
Gerrit-Attention: Yuriy Darnobyt <[email protected]>
Gerrit-Comment-Date: Sat, 14 Nov 2026 16:50:22 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: [email protected]

_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

#16 lore raw

PATCH v7 1/1 Implement multiline responses for pkcs11-id commands

In reply to a message not in the archive

From: Marvin Wunderlich <[email protected]>

Responses to the management interface commands pkcs11-id-[get|count] did not follow the standard syntax, but instead looked like notifications.

Introduce a new management interface version so that clients announcing versions >= 7 will receive responses in the new format while keeping compatibility for older client versions.

If a client announces a management version >= 7 the responses conform to the common multiline + END syntax. At the same time, it is now possible to query all PKCS#11 ids using "all" or a range from "start" to "end" - 1. Failures to retrieve an id will return a partial response terminated by an "ERROR" message including the erroneous index. The response format for pkcs11-id-get was changed to return a comma separated list (index,id,cert_blob) which is easier to parse.

Change-Id I09e55085cde6dbc0040e111a42128527d59832b8

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/2148
---

This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to master.

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/2148
This mail reflects revision 7 of this Change.

Acked-by according to Gerrit (reflected above):
Selva Nair <[email protected]>

doc/management-notes.txt +89 -3
index 6c798c0..42ea644 100644
@@ -617,23 +617,109 @@
 COMMAND -- pkcs11-id-count  (OpenVPN 2.1 or higher)
 ---------------------------------------------------
 
-Retrieve available number of certificates.
+Retrieve available number of PKCS#11 certificates.
+
+For management client versions <7:
+
+     pkcs11-id-count
+
+The reply is ">PKCS11ID-COUNT:<count>".
 
 Example:
 
      pkcs11-id-count
      >PKCS11ID-COUNT:5
 
+For management client versions >= 7:
+
+     pkcs11-id-count
+
+The reply is a decimal count followed by "END" on a separate line.
+
+Example:
+
+     pkcs11-id-count
+     5
+     END
+
 COMMAND -- pkcs11-id-get  (OpenVPN 2.1 or higher)
 -------------------------------------------------
 
+Retrieve PKCS#11 certificates.
+
+For management client versions < 7:
+
+  pkcs11-id-get <index>
+
 Retrieve certificate by index, the ID string should be provided
 as PKCS#11 identity, the blob is a base 64 encoded certificate.
 
 Example:
 
      pkcs11-id-get 1
-     PKCS11ID-ENTRY:'1', ID:'<snip>', BLOB:'<snip>'
+     >PKCS11ID-ENTRY:'1', ID:'<id>', BLOB:'<blob>'
+
+For management client versions >= 7:
+
+  pkcs11-id-get <index>
+  pkcs11-id-get <start> <end>
+  pkcs11-id-get all
+
+Retrieve a single PKCS#11 certificate at index <index> or multiple
+PKCS#11 certificates from index <start> to <end>-1. Alternatively
+<start> = "all" retrieves all PKCS#11 certificates. A comma separated
+list including index, PKCS#11 id and the base 64 encoded certificate
+will be returned. If any id retrieval results in a failure, the returned
+list will be partial and terminated by "ERROR: .." instead of "END".
+The "ERROR" message will include the index of failure.
+
+Example 1:
+
+  Management interface client sends:
+
+    pkcs11-id-get 1
+
+  OpenVPN daemon responds with:
+
+    1,<id>,<blob>
+    END
+
+Example 2:
+
+  Management interface client sends:
+
+    pkcs11-id-get 1 3
+
+  OpenVPN daemon responds with:
+
+    1,<id_a>,<blob_a>
+    2,<id_b>,<blob_b>
+    END
+
+Example 3:
+
+  Management interface client sends:
+
+    pkcs11-id-get all
+
+  OpenVPN daemon with 3 PKCS#11 certificates responds with:
+
+    0,<id_a>,<blob_a>
+    1,<id_b>,<blob_b>
+    2,<id_c>,<blob_c>
+    END
+
+Example 4:
+
+  Management interface client sends:
+
+    pkcs11-id-get all
+
+  OpenVPN daemon with 3 PKCS#11 certificates fails to retrieve index 1
+
+    0,<id_a>,<blob_a>
+    ERROR: Failed to load PKCS#11 id at index: 1
+
 
 COMMAND -- client-auth  (OpenVPN 2.1 or higher)
 -----------------------------------------------
@@ -1240,7 +1326,7 @@
     "ERROR: [text]".
 
 (2) For commands which print multiple lines of output,
-    the last line will be "END".
+    the last line will be "END" or "ERROR: [text]".
 
 (3) Real-time messages will be in the form ">[source]:[text]",
     where source is "CLIENT", "ECHO", "FATAL", "HOLD", "INFO", "LOG",
src/openvpn/manage.c +74 -17

122 lines not on this page · raw message

src/openvpn/manage.h +1 -1
index 82c0caa..1d2aff1 100644
@@ -50,7 +50,7 @@
 #include "socket_util.h"
 #include "mroute.h"
 
-#define MANAGEMENT_VERSION                  6
+#define MANAGEMENT_VERSION                  7
 #define MANAGEMENT_N_PASSWORD_RETRIES       3
 #define MANAGEMENT_LOG_HISTORY_INITIAL_SIZE 100
 #define MANAGEMENT_ECHO_BUFFER_SIZE         100

_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

#17 lore raw
In reply to a message not in the archive

Attention is currently required from: Arne Schwabe, Frank Lichtenheld, Selva Nair, Yuriy Darnobyt, [email protected].

Gert Doering has posted comments on this change by [email protected]. ( https://gerrit.openvpn.net/c/openvpn/+/2148?usp=email )

Change subject: Implement multiline responses for pkcs11-id commands
......................................................................

Patch Set 7: Code-Review-1

(1 comment)

Patchset:

PS7:
Alas, Frank and the Integer crusade crossed the streams here... trying to build this on top of today's master with -Werror errors out with

```
manage.c:923:30: error: implicit conversion changes
      signedness: 'int' to 'unsigned int' [-Werror,-Wsign-conversion]
  923 |         unsigned int count = pkcs11_management_id_count();
      |                      ~~~~~   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
manage.c:939:42: error: implicit conversion changes
      signedness: 'unsigned int' to 'int' [-Werror,-Wsign-conversion]
  939 |             if (pkcs11_management_id_get(i, &id, &base64))
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~ ^
```

can you please rebase, configure with --enable-werror, adjust, and push a new version? thanks...

--
To view, visit https://gerrit.openvpn.net/c/openvpn/+/2148?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: comment
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I09e55085cde6dbc0040e111a42128527d59832b8
Gerrit-Change-Number: 2148
Gerrit-PatchSet: 7
Gerrit-Owner: [email protected]
Gerrit-Reviewer: Arne Schwabe <[email protected]>
Gerrit-Reviewer: Gert Doering <[email protected]>
Gerrit-Reviewer: Selva Nair <[email protected]>
Gerrit-CC: Frank Lichtenheld <[email protected]>
Gerrit-CC: Yuriy Darnobyt <[email protected]>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: Selva Nair <[email protected]>
Gerrit-Attention: [email protected]
Gerrit-Attention: Arne Schwabe <[email protected]>
Gerrit-Attention: Frank Lichtenheld <[email protected]>
Gerrit-Attention: Yuriy Darnobyt <[email protected]>
Gerrit-Comment-Date: Tue, 01 Dec 2026 15:31:48 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes

_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

#18 lore raw
In reply to a message not in the archive

Attention is currently required from: Arne Schwabe, Frank Lichtenheld, Gert Doering, Selva Nair, Yuriy Darnobyt, [email protected].

Hello Arne Schwabe, Gert Doering, Selva Nair,

I'd like you to reexamine a change. Please visit

    https://gerrit.openvpn.net/c/openvpn/+/2148?usp=email

to look at the new patch set (#8).

The following approvals got outdated and were removed:
Code-Review+2 by Selva Nair, Code-Review-1 by Gert Doering

The change is no longer submittable: Code-Review and checks~ChecksSubmitRule are unsatisfied now.

Change subject: Implement multiline responses for pkcs11-id commands
......................................................................

Implement multiline responses for pkcs11-id commands

Responses to the management interface commands pkcs11-id-[get|count] did not follow the standard syntax, but instead looked like notifications.

Introduce a new management interface version so that clients announcing versions >= 7 will receive responses in the new format while keeping compatibility for older client versions.

If a client announces a management version >= 7 the responses conform to the common multiline + END syntax. At the same time, it is now possible to query all PKCS#11 ids using "all" or a range from "start" to "end" - 1. Failures to retrieve an id will return a partial response terminated by an "ERROR" message including the erroneous index. The response format for pkcs11-id-get was changed to return a comma separated list (index,id,cert_blob) which is easier to parse.

Change-Id I09e55085cde6dbc0040e111a42128527d59832b8

---
M doc/management-notes.txt
M src/openvpn/manage.c
M src/openvpn/manage.h

3 files changed, 164 insertions(+), 21 deletions(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/48/2148/8

doc/management-notes.txt +89 -3
index a98b45f..8c8c52e 100644
@@ -617,23 +617,109 @@
 COMMAND -- pkcs11-id-count  (OpenVPN 2.1 or higher)
 ---------------------------------------------------
 
-Retrieve available number of certificates.
+Retrieve available number of PKCS#11 certificates.
+
+For management client versions <7:
+
+     pkcs11-id-count
+
+The reply is ">PKCS11ID-COUNT:<count>".
 
 Example:
 
      pkcs11-id-count
      >PKCS11ID-COUNT:5
 
+For management client versions >= 7:
+
+     pkcs11-id-count
+
+The reply is a decimal count followed by "END" on a separate line.
+
+Example:
+
+     pkcs11-id-count
+     5
+     END
+
 COMMAND -- pkcs11-id-get  (OpenVPN 2.1 or higher)
 -------------------------------------------------
 
+Retrieve PKCS#11 certificates.
+
+For management client versions < 7:
+
+  pkcs11-id-get <index>
+
 Retrieve certificate by index, the ID string should be provided
 as PKCS#11 identity, the blob is a base 64 encoded certificate.
 
 Example:
 
      pkcs11-id-get 1
-     PKCS11ID-ENTRY:'1', ID:'<snip>', BLOB:'<snip>'
+     >PKCS11ID-ENTRY:'1', ID:'<id>', BLOB:'<blob>'
+
+For management client versions >= 7:
+
+  pkcs11-id-get <index>
+  pkcs11-id-get <start> <end>
+  pkcs11-id-get all
+
+Retrieve a single PKCS#11 certificate at index <index> or multiple
+PKCS#11 certificates from index <start> to <end>-1. Alternatively
+<start> = "all" retrieves all PKCS#11 certificates. A comma separated
+list including index, PKCS#11 id and the base 64 encoded certificate
+will be returned. If any id retrieval results in a failure, the returned
+list will be partial and terminated by "ERROR: .." instead of "END".
+The "ERROR" message will include the index of failure.
+
+Example 1:
+
+  Management interface client sends:
+
+    pkcs11-id-get 1
+
+  OpenVPN daemon responds with:
+
+    1,<id>,<blob>
+    END
+
+Example 2:
+
+  Management interface client sends:
+
+    pkcs11-id-get 1 3
+
+  OpenVPN daemon responds with:
+
+    1,<id_a>,<blob_a>
+    2,<id_b>,<blob_b>
+    END
+
+Example 3:
+
+  Management interface client sends:
+
+    pkcs11-id-get all
+
+  OpenVPN daemon with 3 PKCS#11 certificates responds with:
+
+    0,<id_a>,<blob_a>
+    1,<id_b>,<blob_b>
+    2,<id_c>,<blob_c>
+    END
+
+Example 4:
+
+  Management interface client sends:
+
+    pkcs11-id-get all
+
+  OpenVPN daemon with 3 PKCS#11 certificates fails to retrieve index 1
+
+    0,<id_a>,<blob_a>
+    ERROR: Failed to load PKCS#11 id at index: 1
+
 
 COMMAND -- client-auth  (OpenVPN 2.1 or higher)
 -----------------------------------------------
@@ -1240,7 +1326,7 @@
     "ERROR: [text]".
 
 (2) For commands which print multiple lines of output,
-    the last line will be "END".
+    the last line will be "END" or "ERROR: [text]".
 
 (3) Real-time messages will be in the form ">[source]:[text]",
     where source is "CLIENT", "ECHO", "FATAL", "HOLD", "INFO", "LOG",
src/openvpn/manage.c +74 -17

122 lines not on this page · raw message

src/openvpn/manage.h +1 -1
index 697f830..7f26a35 100644
@@ -50,7 +50,7 @@
 #include "socket_util.h"
 #include "mroute.h"
 
-#define MANAGEMENT_VERSION                  6
+#define MANAGEMENT_VERSION                  7
 #define MANAGEMENT_N_PASSWORD_RETRIES       3
 #define MANAGEMENT_LOG_HISTORY_INITIAL_SIZE 100
 #define MANAGEMENT_ECHO_BUFFER_SIZE         100

--
To view, visit https://gerrit.openvpn.net/c/openvpn/+/2148?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: newpatchset
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I09e55085cde6dbc0040e111a42128527d59832b8
Gerrit-Change-Number: 2148
Gerrit-PatchSet: 8
Gerrit-Owner: [email protected]
Gerrit-Reviewer: Arne Schwabe <[email protected]>
Gerrit-Reviewer: Gert Doering <[email protected]>
Gerrit-Reviewer: Selva Nair <[email protected]>
Gerrit-CC: Frank Lichtenheld <[email protected]>
Gerrit-CC: Yuriy Darnobyt <[email protected]>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: Selva Nair <[email protected]>
Gerrit-Attention: [email protected]
Gerrit-Attention: Arne Schwabe <[email protected]>
Gerrit-Attention: Gert Doering <[email protected]>
Gerrit-Attention: Frank Lichtenheld <[email protected]>
Gerrit-Attention: Yuriy Darnobyt <[email protected]>

_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

#19 lore raw
In reply to a message not in the archive

Attention is currently required from: Arne Schwabe, Frank Lichtenheld, Selva Nair, Yuriy Darnobyt, [email protected].

Gert Doering has posted comments on this change by [email protected]. ( https://gerrit.openvpn.net/c/openvpn/+/2148?usp=email )

Change subject: Implement multiline responses for pkcs11-id commands
......................................................................

Patch Set 8: Build-Request+1

(1 comment)

Patchset:

PS8:
Looks good, let's see if this button works ;-)

--
To view, visit https://gerrit.openvpn.net/c/openvpn/+/2148?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: comment
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I09e55085cde6dbc0040e111a42128527d59832b8
Gerrit-Change-Number: 2148
Gerrit-PatchSet: 8
Gerrit-Owner: [email protected]
Gerrit-Reviewer: Arne Schwabe <[email protected]>
Gerrit-Reviewer: Gert Doering <[email protected]>
Gerrit-Reviewer: Selva Nair <[email protected]>
Gerrit-CC: Frank Lichtenheld <[email protected]>
Gerrit-CC: Yuriy Darnobyt <[email protected]>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: Selva Nair <[email protected]>
Gerrit-Attention: [email protected]
Gerrit-Attention: Arne Schwabe <[email protected]>
Gerrit-Attention: Frank Lichtenheld <[email protected]>
Gerrit-Attention: Yuriy Darnobyt <[email protected]>
Gerrit-Comment-Date: Tue, 01 Dec 2026 16:46:51 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes

_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

#20 lore raw
In reply to a message not in the archive

Attention is currently required from: Arne Schwabe, Marvin Wunderlich, Selva Nair, Yuriy Darnobyt.

Frank Lichtenheld has posted comments on this change by Marvin Wunderlich. ( https://gerrit.openvpn.net/c/openvpn/+/2148?usp=email )

Change subject: Implement multiline responses for pkcs11-id commands
......................................................................

Patch Set 8: Code-Review-1

(3 comments)

Patchset:

PS8:
cppcheck complains about wrong format strings

File src/openvpn/manage.c:

https://gerrit.openvpn.net/c/openvpn/+/2148/comment/3fc7a28c_0f34ea57?usp=email :
PS8, Line 941: msg(M_CLIENT, "%u,%s,%s", i, id, base64);

```suggestion
                msg(M_CLIENT, "%d,%s,%s", i, id, base64);
```

https://gerrit.openvpn.net/c/openvpn/+/2148/comment/91d77523_2e7e6270?usp=email :
PS8, Line 946: msg(M_CLIENT, "ERROR: Failed to load PKCS#11 id at index: %u", i);

```suggestion
                msg(M_CLIENT, "ERROR: Failed to load PKCS#11 id at index: %d", i);
```

--
To view, visit https://gerrit.openvpn.net/c/openvpn/+/2148?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: comment
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I09e55085cde6dbc0040e111a42128527d59832b8
Gerrit-Change-Number: 2148
Gerrit-PatchSet: 8
Gerrit-Owner: Marvin Wunderlich <[email protected]>
Gerrit-Reviewer: Arne Schwabe <[email protected]>
Gerrit-Reviewer: Frank Lichtenheld <[email protected]>
Gerrit-Reviewer: Gert Doering <[email protected]>
Gerrit-Reviewer: Selva Nair <[email protected]>
Gerrit-CC: Yuriy Darnobyt <[email protected]>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: Selva Nair <[email protected]>
Gerrit-Attention: Marvin Wunderlich <[email protected]>
Gerrit-Attention: Arne Schwabe <[email protected]>
Gerrit-Attention: Yuriy Darnobyt <[email protected]>
Gerrit-Comment-Date: Tue, 01 Dec 2026 17:11:46 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes

_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

#21 lore raw
In reply to a message not in the archive

Attention is currently required from: Arne Schwabe, Frank Lichtenheld, Gert Doering, Marvin Wunderlich, Selva Nair, Yuriy Darnobyt.

Hello Arne Schwabe, Frank Lichtenheld, Gert Doering, Selva Nair,

I'd like you to reexamine a change. Please visit

    https://gerrit.openvpn.net/c/openvpn/+/2148?usp=email

to look at the new patch set (#9).

The following approvals got outdated and were removed:
Build-Request+1 by Gert Doering, Code-Review-1 by Frank Lichtenheld

Change subject: Implement multiline responses for pkcs11-id commands
......................................................................

Implement multiline responses for pkcs11-id commands

Responses to the management interface commands pkcs11-id-[get|count] did not follow the standard syntax, but instead looked like notifications.

Introduce a new management interface version so that clients announcing versions >= 7 will receive responses in the new format while keeping compatibility for older client versions.

If a client announces a management version >= 7 the responses conform to the common multiline + END syntax. At the same time, it is now possible to query all PKCS#11 ids using "all" or a range from "start" to "end" - 1. Failures to retrieve an id will return a partial response terminated by an "ERROR" message including the erroneous index. The response format for pkcs11-id-get was changed to return a comma separated list (index,id,cert_blob) which is easier to parse.

Change-Id I09e55085cde6dbc0040e111a42128527d59832b8

---
M doc/management-notes.txt
M src/openvpn/manage.c
M src/openvpn/manage.h

3 files changed, 164 insertions(+), 21 deletions(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/48/2148/9

doc/management-notes.txt +89 -3
index a98b45f..8c8c52e 100644
@@ -617,23 +617,109 @@
 COMMAND -- pkcs11-id-count  (OpenVPN 2.1 or higher)
 ---------------------------------------------------
 
-Retrieve available number of certificates.
+Retrieve available number of PKCS#11 certificates.
+
+For management client versions <7:
+
+     pkcs11-id-count
+
+The reply is ">PKCS11ID-COUNT:<count>".
 
 Example:
 
      pkcs11-id-count
      >PKCS11ID-COUNT:5
 
+For management client versions >= 7:
+
+     pkcs11-id-count
+
+The reply is a decimal count followed by "END" on a separate line.
+
+Example:
+
+     pkcs11-id-count
+     5
+     END
+
 COMMAND -- pkcs11-id-get  (OpenVPN 2.1 or higher)
 -------------------------------------------------
 
+Retrieve PKCS#11 certificates.
+
+For management client versions < 7:
+
+  pkcs11-id-get <index>
+
 Retrieve certificate by index, the ID string should be provided
 as PKCS#11 identity, the blob is a base 64 encoded certificate.
 
 Example:
 
      pkcs11-id-get 1
-     PKCS11ID-ENTRY:'1', ID:'<snip>', BLOB:'<snip>'
+     >PKCS11ID-ENTRY:'1', ID:'<id>', BLOB:'<blob>'
+
+For management client versions >= 7:
+
+  pkcs11-id-get <index>
+  pkcs11-id-get <start> <end>
+  pkcs11-id-get all
+
+Retrieve a single PKCS#11 certificate at index <index> or multiple
+PKCS#11 certificates from index <start> to <end>-1. Alternatively
+<start> = "all" retrieves all PKCS#11 certificates. A comma separated
+list including index, PKCS#11 id and the base 64 encoded certificate
+will be returned. If any id retrieval results in a failure, the returned
+list will be partial and terminated by "ERROR: .." instead of "END".
+The "ERROR" message will include the index of failure.
+
+Example 1:
+
+  Management interface client sends:
+
+    pkcs11-id-get 1
+
+  OpenVPN daemon responds with:
+
+    1,<id>,<blob>
+    END
+
+Example 2:
+
+  Management interface client sends:
+
+    pkcs11-id-get 1 3
+
+  OpenVPN daemon responds with:
+
+    1,<id_a>,<blob_a>
+    2,<id_b>,<blob_b>
+    END
+
+Example 3:
+
+  Management interface client sends:
+
+    pkcs11-id-get all
+
+  OpenVPN daemon with 3 PKCS#11 certificates responds with:
+
+    0,<id_a>,<blob_a>
+    1,<id_b>,<blob_b>
+    2,<id_c>,<blob_c>
+    END
+
+Example 4:
+
+  Management interface client sends:
+
+    pkcs11-id-get all
+
+  OpenVPN daemon with 3 PKCS#11 certificates fails to retrieve index 1
+
+    0,<id_a>,<blob_a>
+    ERROR: Failed to load PKCS#11 id at index: 1
+
 
 COMMAND -- client-auth  (OpenVPN 2.1 or higher)
 -----------------------------------------------
@@ -1240,7 +1326,7 @@
     "ERROR: [text]".
 
 (2) For commands which print multiple lines of output,
-    the last line will be "END".
+    the last line will be "END" or "ERROR: [text]".
 
 (3) Real-time messages will be in the form ">[source]:[text]",
     where source is "CLIENT", "ECHO", "FATAL", "HOLD", "INFO", "LOG",
src/openvpn/manage.c +74 -17

122 lines not on this page · raw message

src/openvpn/manage.h +1 -1
index 697f830..7f26a35 100644
@@ -50,7 +50,7 @@
 #include "socket_util.h"
 #include "mroute.h"
 
-#define MANAGEMENT_VERSION                  6
+#define MANAGEMENT_VERSION                  7
 #define MANAGEMENT_N_PASSWORD_RETRIES       3
 #define MANAGEMENT_LOG_HISTORY_INITIAL_SIZE 100
 #define MANAGEMENT_ECHO_BUFFER_SIZE         100

--
To view, visit https://gerrit.openvpn.net/c/openvpn/+/2148?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: newpatchset
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I09e55085cde6dbc0040e111a42128527d59832b8
Gerrit-Change-Number: 2148
Gerrit-PatchSet: 9
Gerrit-Owner: Marvin Wunderlich <[email protected]>
Gerrit-Reviewer: Arne Schwabe <[email protected]>
Gerrit-Reviewer: Frank Lichtenheld <[email protected]>
Gerrit-Reviewer: Gert Doering <[email protected]>
Gerrit-Reviewer: Selva Nair <[email protected]>
Gerrit-CC: Yuriy Darnobyt <[email protected]>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: Selva Nair <[email protected]>
Gerrit-Attention: Marvin Wunderlich <[email protected]>
Gerrit-Attention: Arne Schwabe <[email protected]>
Gerrit-Attention: Gert Doering <[email protected]>
Gerrit-Attention: Frank Lichtenheld <[email protected]>
Gerrit-Attention: Yuriy Darnobyt <[email protected]>

_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

#22 lore raw
In reply to a message not in the archive

Attention is currently required from: Arne Schwabe, Frank Lichtenheld, Gert Doering, Selva Nair, Yuriy Darnobyt.

Marvin Wunderlich has posted comments on this change by Marvin Wunderlich. ( https://gerrit.openvpn.net/c/openvpn/+/2148?usp=email )

Change subject: Implement multiline responses for pkcs11-id commands
......................................................................

Patch Set 9:

(3 comments)

Patchset:

PS8:

Quoted 1 line

cppcheck complains about wrong format strings

Argh. Static code analysis is a blessing...

File src/openvpn/manage.c:

https://gerrit.openvpn.net/c/openvpn/+/2148/comment/201bc32e_893b3f97?usp=email :
PS8, Line 941: msg(M_CLIENT, "%u,%s,%s", i, id, base64);

Quoted 1 line

```suggestion […]

Done

https://gerrit.openvpn.net/c/openvpn/+/2148/comment/9eab80f2_fedff14e?usp=email :
PS8, Line 946: msg(M_CLIENT, "ERROR: Failed to load PKCS#11 id at index: %u", i);

Quoted 1 line

```suggestion […]

Done

--
To view, visit https://gerrit.openvpn.net/c/openvpn/+/2148?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: comment
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I09e55085cde6dbc0040e111a42128527d59832b8
Gerrit-Change-Number: 2148
Gerrit-PatchSet: 9
Gerrit-Owner: Marvin Wunderlich <[email protected]>
Gerrit-Reviewer: Arne Schwabe <[email protected]>
Gerrit-Reviewer: Frank Lichtenheld <[email protected]>
Gerrit-Reviewer: Gert Doering <[email protected]>
Gerrit-Reviewer: Selva Nair <[email protected]>
Gerrit-CC: Yuriy Darnobyt <[email protected]>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: Selva Nair <[email protected]>
Gerrit-Attention: Arne Schwabe <[email protected]>
Gerrit-Attention: Gert Doering <[email protected]>
Gerrit-Attention: Frank Lichtenheld <[email protected]>
Gerrit-Attention: Yuriy Darnobyt <[email protected]>
Gerrit-Comment-Date: Tue, 01 Dec 2026 17:40:11 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Frank Lichtenheld <[email protected]>

_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

#23 lore raw
In reply to a message not in the archive

Attention is currently required from: Arne Schwabe, Frank Lichtenheld, Marvin Wunderlich, Selva Nair, Yuriy Darnobyt.

Gert Doering has posted comments on this change by Marvin Wunderlich. ( https://gerrit.openvpn.net/c/openvpn/+/2148?usp=email )

Change subject: Implement multiline responses for pkcs11-id commands
......................................................................

Patch Set 9: Build-Request+1

(1 comment)

Patchset:

PS9:
build!

--
To view, visit https://gerrit.openvpn.net/c/openvpn/+/2148?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: comment
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I09e55085cde6dbc0040e111a42128527d59832b8
Gerrit-Change-Number: 2148
Gerrit-PatchSet: 9
Gerrit-Owner: Marvin Wunderlich <[email protected]>
Gerrit-Reviewer: Arne Schwabe <[email protected]>
Gerrit-Reviewer: Frank Lichtenheld <[email protected]>
Gerrit-Reviewer: Gert Doering <[email protected]>
Gerrit-Reviewer: Selva Nair <[email protected]>
Gerrit-CC: Yuriy Darnobyt <[email protected]>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: Selva Nair <[email protected]>
Gerrit-Attention: Marvin Wunderlich <[email protected]>
Gerrit-Attention: Arne Schwabe <[email protected]>
Gerrit-Attention: Frank Lichtenheld <[email protected]>
Gerrit-Attention: Yuriy Darnobyt <[email protected]>
Gerrit-Comment-Date: Tue, 01 Dec 2026 20:39:41 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes

_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

#24 lore raw

PATCH v9 1/1 Implement multiline responses for pkcs11-id commands

In reply to a message not in the archive

From: Marvin Wunderlich <[email protected]>

Responses to the management interface commands pkcs11-id-[get|count] did not follow the standard syntax, but instead looked like notifications.

Introduce a new management interface version so that clients announcing versions >= 7 will receive responses in the new format while keeping compatibility for older client versions.

If a client announces a management version >= 7 the responses conform to the common multiline + END syntax. At the same time, it is now possible to query all PKCS#11 ids using "all" or a range from "start" to "end" - 1. Failures to retrieve an id will return a partial response terminated by an "ERROR" message including the erroneous index. The response format for pkcs11-id-get was changed to return a comma separated list (index,id,cert_blob) which is easier to parse.

Change-Id I09e55085cde6dbc0040e111a42128527d59832b8

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/2148
---

This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to master.

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/2148
This mail reflects revision 9 of this Change.

Acked-by according to Gerrit (reflected above):

doc/management-notes.txt +89 -3
index a98b45f..8c8c52e 100644
@@ -617,23 +617,109 @@
 COMMAND -- pkcs11-id-count  (OpenVPN 2.1 or higher)
 ---------------------------------------------------
 
-Retrieve available number of certificates.
+Retrieve available number of PKCS#11 certificates.
+
+For management client versions <7:
+
+     pkcs11-id-count
+
+The reply is ">PKCS11ID-COUNT:<count>".
 
 Example:
 
      pkcs11-id-count
      >PKCS11ID-COUNT:5
 
+For management client versions >= 7:
+
+     pkcs11-id-count
+
+The reply is a decimal count followed by "END" on a separate line.
+
+Example:
+
+     pkcs11-id-count
+     5
+     END
+
 COMMAND -- pkcs11-id-get  (OpenVPN 2.1 or higher)
 -------------------------------------------------
 
+Retrieve PKCS#11 certificates.
+
+For management client versions < 7:
+
+  pkcs11-id-get <index>
+
 Retrieve certificate by index, the ID string should be provided
 as PKCS#11 identity, the blob is a base 64 encoded certificate.
 
 Example:
 
      pkcs11-id-get 1
-     PKCS11ID-ENTRY:'1', ID:'<snip>', BLOB:'<snip>'
+     >PKCS11ID-ENTRY:'1', ID:'<id>', BLOB:'<blob>'
+
+For management client versions >= 7:
+
+  pkcs11-id-get <index>
+  pkcs11-id-get <start> <end>
+  pkcs11-id-get all
+
+Retrieve a single PKCS#11 certificate at index <index> or multiple
+PKCS#11 certificates from index <start> to <end>-1. Alternatively
+<start> = "all" retrieves all PKCS#11 certificates. A comma separated
+list including index, PKCS#11 id and the base 64 encoded certificate
+will be returned. If any id retrieval results in a failure, the returned
+list will be partial and terminated by "ERROR: .." instead of "END".
+The "ERROR" message will include the index of failure.
+
+Example 1:
+
+  Management interface client sends:
+
+    pkcs11-id-get 1
+
+  OpenVPN daemon responds with:
+
+    1,<id>,<blob>
+    END
+
+Example 2:
+
+  Management interface client sends:
+
+    pkcs11-id-get 1 3
+
+  OpenVPN daemon responds with:
+
+    1,<id_a>,<blob_a>
+    2,<id_b>,<blob_b>
+    END
+
+Example 3:
+
+  Management interface client sends:
+
+    pkcs11-id-get all
+
+  OpenVPN daemon with 3 PKCS#11 certificates responds with:
+
+    0,<id_a>,<blob_a>
+    1,<id_b>,<blob_b>
+    2,<id_c>,<blob_c>
+    END
+
+Example 4:
+
+  Management interface client sends:
+
+    pkcs11-id-get all
+
+  OpenVPN daemon with 3 PKCS#11 certificates fails to retrieve index 1
+
+    0,<id_a>,<blob_a>
+    ERROR: Failed to load PKCS#11 id at index: 1
+
 
 COMMAND -- client-auth  (OpenVPN 2.1 or higher)
 -----------------------------------------------
@@ -1240,7 +1326,7 @@
     "ERROR: [text]".
 
 (2) For commands which print multiple lines of output,
-    the last line will be "END".
+    the last line will be "END" or "ERROR: [text]".
 
 (3) Real-time messages will be in the form ">[source]:[text]",
     where source is "CLIENT", "ECHO", "FATAL", "HOLD", "INFO", "LOG",
src/openvpn/manage.c +74 -17

122 lines not on this page · raw message

src/openvpn/manage.h +1 -1
index 697f830..7f26a35 100644
@@ -50,7 +50,7 @@
 #include "socket_util.h"
 #include "mroute.h"
 
-#define MANAGEMENT_VERSION                  6
+#define MANAGEMENT_VERSION                  7
 #define MANAGEMENT_N_PASSWORD_RETRIES       3
 #define MANAGEMENT_LOG_HISTORY_INITIAL_SIZE 100
 #define MANAGEMENT_ECHO_BUFFER_SIZE         100

_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

#25 lore raw

[Openvpn-devel] [PATCH applied] Re: Implement multiline responses for pkcs11-id commands

At last :-) - so, thanks for your contribution, and helping sort out the warts in our management interface protocol. I can see Arne updating opi.py right away...

I've tested this on macOS yesterday, and while I still find all this pkcs11 stuff very confusing, at some point I managed to get output for "old" and "new" format. Things work as described on v7, with no change for the default output.

This change is isolated to manage.c and will not affect anything that is not using management interface v7. So I'm taking the liberty to apply this to release/2.7 as well, because it's useful, and we sort of have the tradition to expedite management interface improvements...

Your patch has been applied to the master and release/2.7 branch.

commit 56e0abbfab0ca9bad8105db16f77efcca8b89833 (master) commit e95224cfc31fa7b1bdd62f827380b8f6c6693c27 (release/2.7)

Author: Marvin Wunderlich
Date:   Tue Dec 1 23:43:08 2026 +0100

Implement multiline responses for pkcs11-id commands

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/2148
Message-Id: <[email protected]>
URL: https://www.mail-archive.com/[email protected]/msg42330.html

--
kind regards,

Gert Doering

_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

#26 lore raw
In reply to a message not in the archive

Gert Doering has uploaded a new patch set (#10) to the change originally created by Marvin Wunderlich. ( https://gerrit.openvpn.net/c/openvpn/+/2148?usp=email )

The following approvals got outdated and were removed:
Build-Request+1 by Gert Doering

Change subject: Implement multiline responses for pkcs11-id commands
......................................................................

Implement multiline responses for pkcs11-id commands

Responses to the management interface commands pkcs11-id-[get|count] did not follow the standard syntax, but instead looked like notifications.

Introduce a new management interface version so that clients announcing versions >= 7 will receive responses in the new format while keeping compatibility for older client versions.

If a client announces a management version >= 7 the responses conform to the common multiline + END syntax. At the same time, it is now possible to query all PKCS#11 ids using "all" or a range from "start" to "end" - 1. Failures to retrieve an id will return a partial response terminated by an "ERROR" message including the erroneous index. The response format for pkcs11-id-get was changed to return a comma separated list (index,id,cert_blob) which is easier to parse.

Change-Id I09e55085cde6dbc0040e111a42128527d59832b8

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/2148
Message-Id: <[email protected]>
URL: https://www.mail-archive.com/[email protected]/msg42330.html

---
M doc/management-notes.txt
M src/openvpn/manage.c
M src/openvpn/manage.h

3 files changed, 164 insertions(+), 21 deletions(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/48/2148/10

doc/management-notes.txt +89 -3
index a98b45f..8c8c52e 100644
@@ -617,23 +617,109 @@
 COMMAND -- pkcs11-id-count  (OpenVPN 2.1 or higher)
 ---------------------------------------------------
 
-Retrieve available number of certificates.
+Retrieve available number of PKCS#11 certificates.
+
+For management client versions <7:
+
+     pkcs11-id-count
+
+The reply is ">PKCS11ID-COUNT:<count>".
 
 Example:
 
      pkcs11-id-count
      >PKCS11ID-COUNT:5
 
+For management client versions >= 7:
+
+     pkcs11-id-count
+
+The reply is a decimal count followed by "END" on a separate line.
+
+Example:
+
+     pkcs11-id-count
+     5
+     END
+
 COMMAND -- pkcs11-id-get  (OpenVPN 2.1 or higher)
 -------------------------------------------------
 
+Retrieve PKCS#11 certificates.
+
+For management client versions < 7:
+
+  pkcs11-id-get <index>
+
 Retrieve certificate by index, the ID string should be provided
 as PKCS#11 identity, the blob is a base 64 encoded certificate.
 
 Example:
 
      pkcs11-id-get 1
-     PKCS11ID-ENTRY:'1', ID:'<snip>', BLOB:'<snip>'
+     >PKCS11ID-ENTRY:'1', ID:'<id>', BLOB:'<blob>'
+
+For management client versions >= 7:
+
+  pkcs11-id-get <index>
+  pkcs11-id-get <start> <end>
+  pkcs11-id-get all
+
+Retrieve a single PKCS#11 certificate at index <index> or multiple
+PKCS#11 certificates from index <start> to <end>-1. Alternatively
+<start> = "all" retrieves all PKCS#11 certificates. A comma separated
+list including index, PKCS#11 id and the base 64 encoded certificate
+will be returned. If any id retrieval results in a failure, the returned
+list will be partial and terminated by "ERROR: .." instead of "END".
+The "ERROR" message will include the index of failure.
+
+Example 1:
+
+  Management interface client sends:
+
+    pkcs11-id-get 1
+
+  OpenVPN daemon responds with:
+
+    1,<id>,<blob>
+    END
+
+Example 2:
+
+  Management interface client sends:
+
+    pkcs11-id-get 1 3
+
+  OpenVPN daemon responds with:
+
+    1,<id_a>,<blob_a>
+    2,<id_b>,<blob_b>
+    END
+
+Example 3:
+
+  Management interface client sends:
+
+    pkcs11-id-get all
+
+  OpenVPN daemon with 3 PKCS#11 certificates responds with:
+
+    0,<id_a>,<blob_a>
+    1,<id_b>,<blob_b>
+    2,<id_c>,<blob_c>
+    END
+
+Example 4:
+
+  Management interface client sends:
+
+    pkcs11-id-get all
+
+  OpenVPN daemon with 3 PKCS#11 certificates fails to retrieve index 1
+
+    0,<id_a>,<blob_a>
+    ERROR: Failed to load PKCS#11 id at index: 1
+
 
 COMMAND -- client-auth  (OpenVPN 2.1 or higher)
 -----------------------------------------------
@@ -1240,7 +1326,7 @@
     "ERROR: [text]".
 
 (2) For commands which print multiple lines of output,
-    the last line will be "END".
+    the last line will be "END" or "ERROR: [text]".
 
 (3) Real-time messages will be in the form ">[source]:[text]",
     where source is "CLIENT", "ECHO", "FATAL", "HOLD", "INFO", "LOG",
src/openvpn/manage.c +74 -17

122 lines not on this page · raw message

src/openvpn/manage.h +1 -1
index 697f830..7f26a35 100644
@@ -50,7 +50,7 @@
 #include "socket_util.h"
 #include "mroute.h"
 
-#define MANAGEMENT_VERSION                  6
+#define MANAGEMENT_VERSION                  7
 #define MANAGEMENT_N_PASSWORD_RETRIES       3
 #define MANAGEMENT_LOG_HISTORY_INITIAL_SIZE 100
 #define MANAGEMENT_ECHO_BUFFER_SIZE         100

--
To view, visit https://gerrit.openvpn.net/c/openvpn/+/2148?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: newpatchset
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I09e55085cde6dbc0040e111a42128527d59832b8
Gerrit-Change-Number: 2148
Gerrit-PatchSet: 10
Gerrit-Owner: Marvin Wunderlich <[email protected]>
Gerrit-Reviewer: Arne Schwabe <[email protected]>
Gerrit-Reviewer: Frank Lichtenheld <[email protected]>
Gerrit-Reviewer: Gert Doering <[email protected]>
Gerrit-Reviewer: Selva Nair <[email protected]>
Gerrit-CC: Yuriy Darnobyt <[email protected]>
Gerrit-CC: openvpn-devel <[email protected]>

_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

#27 lore raw
In reply to a message not in the archive

Gert Doering has submitted this change. ( https://gerrit.openvpn.net/c/openvpn/+/2148?usp=email )

Change subject: Implement multiline responses for pkcs11-id commands
......................................................................

Implement multiline responses for pkcs11-id commands

Responses to the management interface commands pkcs11-id-[get|count] did not follow the standard syntax, but instead looked like notifications.

Introduce a new management interface version so that clients announcing versions >= 7 will receive responses in the new format while keeping compatibility for older client versions.

If a client announces a management version >= 7 the responses conform to the common multiline + END syntax. At the same time, it is now possible to query all PKCS#11 ids using "all" or a range from "start" to "end" - 1. Failures to retrieve an id will return a partial response terminated by an "ERROR" message including the erroneous index. The response format for pkcs11-id-get was changed to return a comma separated list (index,id,cert_blob) which is easier to parse.

Change-Id I09e55085cde6dbc0040e111a42128527d59832b8

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/2148
Message-Id: <[email protected]>
URL: https://www.mail-archive.com/[email protected]/msg42330.html

---
M doc/management-notes.txt
M src/openvpn/manage.c
M src/openvpn/manage.h

3 files changed, 164 insertions(+), 21 deletions(-)
doc/management-notes.txt +89 -3
index a98b45f..8c8c52e 100644
@@ -617,23 +617,109 @@
 COMMAND -- pkcs11-id-count  (OpenVPN 2.1 or higher)
 ---------------------------------------------------
 
-Retrieve available number of certificates.
+Retrieve available number of PKCS#11 certificates.
+
+For management client versions <7:
+
+     pkcs11-id-count
+
+The reply is ">PKCS11ID-COUNT:<count>".
 
 Example:
 
      pkcs11-id-count
      >PKCS11ID-COUNT:5
 
+For management client versions >= 7:
+
+     pkcs11-id-count
+
+The reply is a decimal count followed by "END" on a separate line.
+
+Example:
+
+     pkcs11-id-count
+     5
+     END
+
 COMMAND -- pkcs11-id-get  (OpenVPN 2.1 or higher)
 -------------------------------------------------
 
+Retrieve PKCS#11 certificates.
+
+For management client versions < 7:
+
+  pkcs11-id-get <index>
+
 Retrieve certificate by index, the ID string should be provided
 as PKCS#11 identity, the blob is a base 64 encoded certificate.
 
 Example:
 
      pkcs11-id-get 1
-     PKCS11ID-ENTRY:'1', ID:'<snip>', BLOB:'<snip>'
+     >PKCS11ID-ENTRY:'1', ID:'<id>', BLOB:'<blob>'
+
+For management client versions >= 7:
+
+  pkcs11-id-get <index>
+  pkcs11-id-get <start> <end>
+  pkcs11-id-get all
+
+Retrieve a single PKCS#11 certificate at index <index> or multiple
+PKCS#11 certificates from index <start> to <end>-1. Alternatively
+<start> = "all" retrieves all PKCS#11 certificates. A comma separated
+list including index, PKCS#11 id and the base 64 encoded certificate
+will be returned. If any id retrieval results in a failure, the returned
+list will be partial and terminated by "ERROR: .." instead of "END".
+The "ERROR" message will include the index of failure.
+
+Example 1:
+
+  Management interface client sends:
+
+    pkcs11-id-get 1
+
+  OpenVPN daemon responds with:
+
+    1,<id>,<blob>
+    END
+
+Example 2:
+
+  Management interface client sends:
+
+    pkcs11-id-get 1 3
+
+  OpenVPN daemon responds with:
+
+    1,<id_a>,<blob_a>
+    2,<id_b>,<blob_b>
+    END
+
+Example 3:
+
+  Management interface client sends:
+
+    pkcs11-id-get all
+
+  OpenVPN daemon with 3 PKCS#11 certificates responds with:
+
+    0,<id_a>,<blob_a>
+    1,<id_b>,<blob_b>
+    2,<id_c>,<blob_c>
+    END
+
+Example 4:
+
+  Management interface client sends:
+
+    pkcs11-id-get all
+
+  OpenVPN daemon with 3 PKCS#11 certificates fails to retrieve index 1
+
+    0,<id_a>,<blob_a>
+    ERROR: Failed to load PKCS#11 id at index: 1
+
 
 COMMAND -- client-auth  (OpenVPN 2.1 or higher)
 -----------------------------------------------
@@ -1240,7 +1326,7 @@
     "ERROR: [text]".
 
 (2) For commands which print multiple lines of output,
-    the last line will be "END".
+    the last line will be "END" or "ERROR: [text]".
 
 (3) Real-time messages will be in the form ">[source]:[text]",
     where source is "CLIENT", "ECHO", "FATAL", "HOLD", "INFO", "LOG",
src/openvpn/manage.c +74 -17

122 lines not on this page · raw message

src/openvpn/manage.h +1 -1
index 697f830..7f26a35 100644
@@ -50,7 +50,7 @@
 #include "socket_util.h"
 #include "mroute.h"
 
-#define MANAGEMENT_VERSION                  6
+#define MANAGEMENT_VERSION                  7
 #define MANAGEMENT_N_PASSWORD_RETRIES       3
 #define MANAGEMENT_LOG_HISTORY_INITIAL_SIZE 100
 #define MANAGEMENT_ECHO_BUFFER_SIZE         100

--
To view, visit https://gerrit.openvpn.net/c/openvpn/+/2148?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: merged
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I09e55085cde6dbc0040e111a42128527d59832b8
Gerrit-Change-Number: 2148
Gerrit-PatchSet: 10
Gerrit-Owner: Marvin Wunderlich <[email protected]>
Gerrit-Reviewer: Arne Schwabe <[email protected]>
Gerrit-Reviewer: Frank Lichtenheld <[email protected]>
Gerrit-Reviewer: Gert Doering <[email protected]>
Gerrit-Reviewer: Selva Nair <[email protected]>
Gerrit-CC: Yuriy Darnobyt <[email protected]>
Gerrit-CC: openvpn-devel <[email protected]>

_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel